package all

import "fmt"

//观察者

type Observer interface {
	Update(string)
	GetId() string
}

// Customer 观察者的具体实现
type Customer struct {
	Id string
}

func (c *Customer) Update(itemName string) {
	fmt.Printf("Sending email to customer %s for item %s\n", c.Id, itemName)
}

func (c *Customer) GetId() string {
	return c.Id
}
